#!/bin/bash
# 启动 RAGent-Platform 服务

echo "🚀 Starting RAGent-Platform..."

# 创建必要目录
mkdir -p dataset/pdf dataset/sqlite dataset/vector_db
mkdir -p logs

# 安装依赖（首次运行）
if [ ! -f ".deps_installed" ]; then
    echo "📦 Installing dependencies..."
    pip install -r requirements.txt
    touch .deps_installed
fi

# 启动服务
uvicorn app.main:app \
    --host $(python -c "from app.core.config import SERVER_HOST; print(SERVER_HOST)") \
    --port $(python -c "from app.core.config import SERVER_PORT; print(SERVER_PORT)") \
    --reload